@import "../../styles/colors";

.cm-table-wrap{
    position: relative;
}
.cm-table{
    width: inherit;
    height: 100%;
    max-width: 100%;
    overflow: hidden;
    color: @color-ctx;
    font-size: 14px;
    background-color: #fff;
    box-sizing: border-box;
    table {
        table-layout: fixed;
    }
    td,
    th {
        min-width: 0;
        height: 48px;
        box-sizing: border-box;
        text-align: left;
        text-overflow: ellipsis;
        vertical-align: middle;
        border-bottom: 1px solid #e8eaec;
    }
    td{
        background-color: #fff;
        transition: background-color .2s ease-in-out;
    }
    th {
        height: 40px;
        white-space: nowrap;
        overflow: hidden;
        background-color: #f8f8f9;
    }
    .cm-table-tbody {
        tr.cm-table-row-hover{
            td{
                background-color: #ebf7ff!important;
            }
        }
    }
}
.cm-table-bordered{
    border: 1px solid @color-border;
    border-right: 0;
    border-bottom: 0;
    td,th{
        border-right: 1px solid @color-border;
    }
    &:before,
    &:after{
        content: "";
        position: absolute;
        background-color: #dcdee2;
    }
    &:before {
        width: 100%;
        height: 1px;
        left: 0;
        bottom: 0;
        z-index: 1;
    }
    &:after {
        width: 1px;
        height: 100%;
        top: 0;
        right: 0;
        z-index: 3;
    }
    .cm-table-fixed{
        top: 1px;
        left: 1px;
    }
    .cm-table-fixed-right{
        top: 1px;
        right: 1px;
    }
}

.cm-table-stripe .cm-table-tbody{
    .cm-table-row:nth-child(2n) td{
        background-color: @color-bg;
    }
}

.cm-table-header{
    overflow: hidden;
    table th{
        position: relative;
        height: 100%;
        padding: 8px 0;
    }
}
.cm-table-cell{
    padding-left: 18px;
    padding-right: 18px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    word-break: break-all;
    box-sizing: border-box;
    .cm-checkbox{
        margin-right: 0px;
        .cm-checkbox-outter{
            margin: 0;
        }
    }
}

th .ivu-table-cell {
    display: inline-block;
    word-wrap: normal;
    vertical-align: middle;
}


.cm-table-body{
    overflow: auto;
}

.cm-table-fixed{
    position: absolute;
    top: 0;
    left: 0;
    box-shadow: 0px 0 6px -2px rgba(0,0,0,.2);
}
.cm-table-fixed-right{
    position: absolute;
    top: 0;
    right: 0;
    box-shadow: -2px 0 4px -2px rgba(0, 0, 0, 0.2);
}
.cm-table-fixed-body,
.cm-table-fixed-header{
    overflow: hidden;
}
.cm-table-fixed-right-header{
    position: absolute;
    right: 0;
    top: 0;
    background-color: #f8f8f9;
}

.cm-table-sort {
    display: inline-block;
    width: 16px;
    height: 20px;
    margin-top: -1px;
    vertical-align: middle;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    svg {
        display: block;
        height: 10px;
        width: 16px;
        overflow: hidden;
        position: absolute;
        color: #555;
        transition: color .2s ease-in-out;
        font-size: 14px;
        text-align: center;
        &:first-child {
            top: 0px;
            &:before{
                position: relative;
                top: -4px;
            }
        }
        &:last-child {
            bottom: 0px;
            &:before{
                position: relative;
                top: -4px;
            }
        }
        &.cm-table-sort-active{
            color: @color-blue-light;
        }
    }
}
.cm-table-filter {
    display: inline-block;
    cursor: pointer;
    position: relative;
    top: 1px;
    margin-left: 3px;
    svg {
        color: #c5c8ce;
        width: 14px;
        transition: color .2s ease-in-out;
    }
    &:hover i {
        color: inherit;
    }
}
.cm-table td.cm-table-no-data{
    text-align: center;
}
.cm-table-filter-list{
    .cm-dropdown-menu{
        max-height: 200px;
        overflow: auto;
    }
}